Instant Messaging (IM) applications are very popular communications software used by web portals and e-commerce websites. Examples of IM applications include Windows Live Messenger, Yahoo Messenger, Ali Wang Wang, Netease Pao Pao, and the like. They are mainly intended to enable a user to locate rapidly, conduct a real time talk, and mutual information transfer with a friend or a business partner of the user over the Internet. Moreover, much of the existing IM software is also integrated with functions of data exchange, voice chat, network conference, email, etc.
FIG. 1 is an example graphic user interface (GUI) used in certain existing IM applications. A main interface 10 includes a multi-tab area 11 and a primary presentation area 12. The tab area 11 contains several tabs 13. A display control on main interface 10 of the IM software is typically generated when the application executes. When a user selects one of the tabs, content to be presented corresponding to the selected tab is displayed in the primary presentation area 12. This process is commonly referred to as tab switching. In some implementations, special display code is programmed for each tab. The display code is in turn embedded in the display control code of the main interface. When the user switches tabs, the display code of the newly selected tab is invoked to display the contents of the tab.
The existing implementation has several drawbacks. For example, since the tab display code is embedded in the display control code of the main interface, the programmer has to consider the issues of interaction, cooperation, and logical coupling between the tab presentation areas and the control on interface elements of the main interface. Thus, a change to the contents of the main interface will affect directly the presentation of tab contents and a change to a presentation area of tab contents will also affect the layout of the main interface, making the implementation of the tab code cumbersome. Also, the current implementation typically results in poor extendibility. When tabs are added or removed in the tab area 11, the code corresponding to the main interface 10 has to be modified, taking in account not only the tab contents but also the layout of the main interface. This would require both more time and effort by the programmer and would make the software more error-prone. Additionally, considerable system resources have to be devoted to tracking the tab contents. Since the contents of the tabs is regarded as a sub-component of the main interface, a presentation area of the tab contents tends to be created along with a “Contact List” after the main interface is created. Although the presentation area is hidden, additional system resources such as memory, handles, etc., are still occupied while the program is running. Lastly, the strong coupling involved in the existing implementation may discourage the division of programming tasks by developers during development of the application.